﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;

namespace 电子病历
{
    public partial class 住院诊断选择 : Form
    {
        public 住院诊断选择()
        {
            InitializeComponent();
        }
        string constr = ConfigurationManager.ConnectionStrings["EMR"].ConnectionString;
        private void 住院诊断选择_Load(object sender, EventArgs e)
        {
            SqlConnection conn = new SqlConnection(constr);
            conn.Open();
            string sqlstr = "SELECT icd,icdmc FROM [h_icd]";
            SqlDataAdapter sda = new SqlDataAdapter(sqlstr, conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            dataGridView1.DataSource = dt;
            conn.Close();
        }

        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            if (this.dataGridView1.CurrentRow != null)
            {
                chuanzhi.zyicd = this.dataGridView1.CurrentRow.Cells[0].Value.ToString();
                chuanzhi.zyzd = this.dataGridView1.CurrentRow.Cells[1].Value.ToString();
                this.Close();
            }

        }
    }
}
